con

  _clkfreq = 80_000_000
  _clkmode = xtal1 + pll16x




  TX_PIN        = 30
  BAUDRATE      = 115_200

pub go | i

'  waitcnt(cnt + clkfreq<<0)

  'coginit(1, @Entry, 0)

  'return
  
  'launch each cog in decending order, waiting a brief time before launching the next cog
  repeat i from 7 to 0 
    coginit(i, @Entry, 0)
    'repeat 10000                   'code execution pause (do nothing loop)
    waitcnt(cnt + clkfreq>>5)

  repeat
dat

        'assembly program to write a bit pattern out to
        'every Hub RAM address and verify it

              org

Entry

              cogid     t0
              add       t0,#16
              mov       pin_mask,#1
              shl       pin_mask,t0
              or        dira,pin_mask

              
              mov       t1,_1sec
              shr       t1,#2
              mov       t0,t1
              add       t0,cnt

:loop         xor       outa,pin_mask
              waitcnt   t0,t1
              jmp       #:loop               
              





_1sec         long      _clkfreq


pin_mask      res       1
t0            res       1
t1            res       1
t2            res       1
t3            res       1


